import * as Koa from 'koa';
import * as bodyParser from 'koa-bodyparser';
import router from './controller/index';
import catchError from './middlewares/exceptions';

const app = new Koa();

app.listen(3000);

app.use(catchError);
app.use(bodyParser());
// @ts-ignore
app.use(router.routes());
// @ts-ignore
app.use(router.allowedMethods());

console.log('start: http://localhost:3000');
